/**
 * 内容方法
 */
import layer from './base/layer.js'
import permission from './base/permission.js'

var option = {
	elem: "#page",
	url: null,
}
var nav=[]; //导航目录
var page = new function() {
	this.render = function(opt) {
		$.extend(option, opt)
	}
	this.loadPage = function(opt) {
		$.extend(option, opt)
		const $frame = $(option.elem);
		$.ajax({
			type: 'get',
			url: opt.url,
			dataType: 'html',
			success: function(data) {
				$frame.html(data);
				permission.validPerm();
			},
			error: function(xhr) {
				return layer.alert('Status:' + xhr.status + '，' + xhr.statusText + '，请稍后再试！', 'danger');
			}
		});
	}
	
	
	
}

export default page;